name: Демонстрация GitVerse CI/CD и cloud.ru Evolution Artifact Registry
on:
  push:
env:
  EVOAR_URI: demo1204.cr.cloud.ru
jobs:
  build-test:
    name: Demo build and push to Evolution Artifact Registry
    runs-on: ubuntu-latest
    container:
      image: catthehacker/ubuntu:act-latest
    steps:
      - name: Checkout to the branch
        uses: https://github.com/actions/checkout@v3
      - name: Set up Docker buildx
        uses: https://github.com/docker/setup-buildx-action@v1
      
      - name: Log in to Evolution Artifact Registry
        uses: https://github.com/docker/login-action@v2
        with:
          registry: ${{ env.EVOAR_URI }}
          username: ${{ secrets.EVOAR_KEYID }}
          password: ${{ secrets.EVOAR_KEYSECRET }}
      
      - name: Build and push docker image to Evolution Artifact Registry
        uses: https://github.com/docker/build-push-action@v4
        with:
          push: true
          platforms: linux/amd64
          provenance: false
          tags: ${{ env.EVOAR_URI }}/helloworld:build${{ github.sha }}
          file: ./Dockerfile
          context: .